#ifndef CONSTANTS
	#define CONSTANTS

	#define TRUE 1
	#define FALSE 0
	#define MAX_IDENT_SIZE 64

	#define TOKEN_TYPE_INT              0           // An integer literal
	#define TOKEN_TYPE_FLOAT            1           // An floating-point literal
	#define TOKEN_TYPE_STRING           2           // An string literal
	#define TOKEN_TYPE_QUOTE            3           // A double-quote
	#define TOKEN_TYPE_IDENT            4           // An identifier
	#define TOKEN_TYPE_COLON            5           // A colon
	#define TOKEN_TYPE_OPEN_BRACKET     6           // An openening bracket
	#define TOKEN_TYPE_CLOSE_BRACKET    7           // An closing bracket
	#define TOKEN_TYPE_COMMA            8           // A comma
	#define TOKEN_TYPE_OPEN_BRACE       9           // An openening curly brace
	#define TOKEN_TYPE_CLOSE_BRACE      10          // An closing curly brace
	#define TOKEN_TYPE_NEWLINE          11          // A newline

	#define TOKEN_TYPE_INSTR	    12		// An instruction

	#define TOKEN_TYPE_SETSTACKSIZE     13          // The SetStackSize directive
	#define TOKEN_TYPE_VAR              14          // The Var/Var [] directives
	#define TOKEN_TYPE_FUNC             15          // The Func directives
	#define TOKEN_TYPE_PARAM            16          // The Param directives
	#define TOKEN_TYPE_REG_RETVAL       17          // The _RetVal directives

	#define TOKEN_TYPE_INVALID          18          // Error code for invalid tokens
	#define END_OF_TOKEN_STREAM         19          // The end of the stream has been reached

	#define MAX_LEXEME_SIZE             256         // Maximum lexeme size

	#define LEX_STATE_NO_STRING         0           // Lexemes are scanned as normal
	#define LEX_STATE_IN_STRING         1           // Lexemes are scanned as strings
	#define LEX_STATE_END_STRING        2           // Lexemes are scanned as normal, and the next state is LEXEME_STATE_NOSTRING

	#define MAX_SOURCE_LINE_SIZE        4096

	#define ERROR_MSSG_INVALID_INPUT	\
		"Invalid input"
	
	#define ERROR_MSSG_LOCAL_SETSTACKSIZE	\
		"SetStackSize can only appear in the global scope"
	
	#define ERROR_MSSG_INVALID_STACK_SIZE	\
		"Invalid stack size"
	
	#define ERROR_MSSG_MULTIPLE_SETSTACKSIZES	\
		"Multiple instances of SetStackSize illegal"
	
	#define ERROR_MSSG_IDENT_EXPECTED	\
		"Identifier expected"
	
	#define ERROR_MSSG_INVALID_ARRAY_SIZE	\
		"Invalid array size"
	
	#define ERROR_MSSG_IDENT_REDEFINITION	\
		"Identifier redefinition"
	
	#define ERROR_MSSG_UNDEFINED_IDENT	\
		"Undefined identifier"
	
	#define ERROR_MSSG_NESTED_FUNC	\
		"Nested functions illegal"
	
	#define ERROR_MSSG_FUNC_REDEFINITION	\
		"Function redefinition"
	
	#define ERROR_MSSG_UNDEFINED_FUNC	\
		"Undefined function"
	
	#define ERROR_MSSG_GLOBAL_PARAM	\
		"Parameters can only appear inside functions"
	
	#define ERROR_MSSG_MAIN_PARAM	\
		"_Main () function cannot accept parameters"
	
	#define ERROR_MSSG_GLOBAL_LINE_LABEL	\
		"Line labels can only appear inside functions"
	
	#define ERROR_MSSG_LINE_LABEL_REDEFINITION	\
		"Line label redefinition"
	
	#define ERROR_MSSG_UNDEFINED_LINE_LABEL	\
		"Undefined line label"
	
	#define ERROR_MSSG_GLOBAL_INSTR	\
		"Instructions can only appear inside functions"
	
	#define ERROR_MSSG_INVALID_INSTR	\
		"Invalid instruction"
	
	#define ERROR_MSSG_INVALID_OP	\
		"Invalid operand"
	
	#define ERROR_MSSG_INVALID_STRING	\
		"Invalid string"
	
	#define ERROR_MSSG_INVALID_ARRAY_NOT_INDEXED	\
		"Arrays must be indexed"
	
	#define ERROR_MSSG_INVALID_ARRAY	\
		"Invalid array"
	
	#define ERROR_MSSG_INVALID_ARRAY_INDEX	\
		"Invalid array index"

	#define MAIN_FUNC_NAME	"MAIN"
	#define EXEC_FILE_EXT	".XSE"
	#define XSE_ID_STRING	"XSE0"

	#define LOAD_OK				0			// Load successful
	#define LOAD_ERROR_FILE_IO 		1			// File I/O error (most likely a file
	#define LOAD_ERROR_INVALID_XSE		2			// Invalid .XSE structure
	#define LOAD_ERROR_UNSUPPORTED_VERS	3			// The format version is unsupported

	#define DEF_STACK_SIZE			    1024
	#define MAX_COERCION_STRING_SIZE    65
#endif
